<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <router-link to="/home">首页</router-link>
    <router-link to="/vip">会员</router-link>
    <router-view></router-view>
</div>
<script src="vue.js"></script>
<script src="./node_modules/vue-router/dist/vue-router.js"></script>
<script>
    var Home={
        template:'<h1>这是home组件</h1>'
    };
    var Vip={
        template:'<h1>这是vip组件</h1>'
    };
    var router=new VueRouter({
        routes:[
            {path:'/home',compnent:Home},
            {path:'/vip',compnent:Vip}
        ]
    })
    var vm = new Vue({
        el: '#app',
        data: {
            
        },
        router:router

    })
</script>
</body>
</html>